From b1f64c5b903b3b99972e9d76e00159b4c5fcd02e Mon Sep 17 00:00:00 2001 From: "vh249@kneesaa.uk.xensource.com" Date: Sun, 9 Oct 2005 12:29:24 -0400 Subject: [PATCH] Don't increment mi->usage is alloc_major_info return NULL Signed-off-by: Vincent Hanquez --- linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c index 01b62e695d..49a6ab4882 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c @@ -160,7 +160,8 @@ xlbd_get_major_info(int vdevice) mi = ((major_info[index] != NULL) ? major_info[index] : xlbd_alloc_major_info(major, minor, index)); - mi->usage++; + if (mi) + mi->usage++; return mi; } -- 2.30.2